<?php

class tbdata_mdl_cats extends dbeav_model{
	public function get_all_leaf_cat($cid,&$return){
		$cids = $this->getList('*',array('parent_cid'=>$cid),0,-1);
		foreach($cids as $cid){
			$rows = $this->getList('*',array('parent_cid'=>$cid['cid']),0,-1);
			if($rows[0]){
				$this->get_all_leaf_cat($cid['cid'],$return);
			}else{
				$return[$cid['cid']] = $cid;
			}
		}
	}
}